<div class="jobs view">
<div class="widget" id="widget_job_view" style="width: 96%">
    <div class="toggle">&nbsp;</div>
    <h3 class="handle"><?php printf(__('View Job By Company (%s)', true), $company['Company']['name']);?></h3>
    <div class="content">
    <?php if(count($jobs) > 1): ?>
        <!-- to avoid two loops over the same array -->
        <ul class="tabs">
            <?php foreach($jobs as $i=>$job): ?>
                <li class="job_title" target="#job_content_<?php e($job['Job']['id']); ?>">
                    <a href="javascript:void(0)"><?php e($job['Job']['title']); ?></a>
                </li>
            <?php endforeach; ?>
        </ul>
        <!-- loop to create titles and job contents -->
        <div class="panes">
            <?php foreach($jobs as $i=>$job): ?>
                <div class="job_content" id="job_content_<?php e($job['Job']['id']); ?>">
                    <?php e($this->element('view_job', array('job'=>$job, 'company'=>$company))); ?>
                </div>
            <?php endforeach; ?>
        </div>

    <?php else: ?>
        <?php e($this->element('view_job', array('job'=>$jobs[0], 'company'=>$company))); ?>
    <?php endif; ?>
    </div>
</div>
</div>

<script type="text/javascript">
jQuery(function(){
    $('ul.tabs').tabs('div.panes > div.job_content');
    $('a.link_apply_for_the_job').click($.sme.cbk.ajaxApply);
});
</script>